<html>
    <head>
        <title>Series de Tarjetas</title>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <?php echo link_tag('bootstrap/css/estilo.css') ?>
        <?php echo link_tag('bootstrap/css/bootstrap.min.css') ?>
        <?php echo link_tag('bootstrap/css/layout.css') ?>
        <?php echo link_tag('bootstrap/css/tablascss.css') ?>
    </head>
    <body>
        <fieldset>
            <div class="body" id="container">
                <section id="buttonGroups">
                    <div class="page-header">
                        <h1>Generar Series de Tarjetas SIMERT</h1>
                    </div>
                    <div class="row">
                        <div class="span8">
                            <form method="POST" action="/simertweb/generar_serie_tarjetas" class="form-horizontal">
                                <?php if (!empty($series)) {
//                                    var_dump($series);
                                    for ($i=0; $i<count($series); $i++) {
                                        $serie = $series[$i]['hasta'];
                                    } ?>
                                        <div class="alert alert-info">
                                            <b>Ingrese la serie a generar (último dígito de la serie ingresada: <?php echo ($serie )  ?> )</b>
                                        </div>
                                 <?php }?>
                            </form> 
                            
                            <form  method="POST" action="/simertweb/generar_serie_tarjetas/guardar" class="form-horizontal">
                                <?php echo $series[0]['mensaje'] ?>
                                <?php echo form_error('inicio'); ?>
                                <?php echo form_error('fin'); ?>
                                <div class="controls">
                                    <br>
                                    Desde:&nbsp;&nbsp;
                                    <input name="inicio" type="text" class="input-mini">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                    Hasta:&nbsp;&nbsp;
                                    <input name="fin" type="text" class="input-mini">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br><br>
                                </div>

                                <div class="controls">
                                    <button type="submit" class="btn btn-primary">Generar</button>                                         
                                    <br><br>
                                </div> 
                                <label><h2>Lista de Series Creadas</h2></label>
                                <div class="datagrid" style="margin-right: -45px">                                    
                                    <table  class="table" border=2 style=" overflow-y: scroll">  
                                        <tr>
                                            <td  bgcolor="#CCCOCC"><center><b>N°</b></center></td>
                                            <td bgcolor="#CCCOCC"><center><b>Desde</b></center></td>
                                            <td bgcolor="#CCCOCC"><center><b>Hasta</b></center></td>
                                        </tr>

                                        <?php
                                        if(!empty($series)){
                                        $c=1;
                                        for ($i=0; $i<count($series); $i++) { ?>
                                            <tr >
                                                <td><center><?php echo $c++; ?></center></td>
                                                <td><center><?php echo $series[$i]['desde'] ?></center></td>
                                                <td><center><?php echo $series[$i]['hasta'] ?></center></td>
                                            </tr>                            
                                        <?php } 
                                        }?>
                                    </table>
                                </div>
                            </form>
                        </div>
                    </div>
                </section>     
            </div>
        </fieldset>
    </body>
</html>
